<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <title>稻稻工厂—商户自营管理</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/bootstrap-responsive.min.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/colorpicker.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/datepicker.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/uniform.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/select2.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/matrix-style.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/matrix-media.css" />
    <link rel="stylesheet" href="/thinkphp/Public/admin/css/bootstrap-wysihtml5.css" />
    <link href="/thinkphp/Public/admin/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <link href='http://fonts.useso.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'>
    <script src="/thinkphp/Public/admin/js/jquery.min.js"></script>
</head>

<body>
<!--Header-part-->
<div id="header">
    <h1><a href="dashboard.html">商户自营管理</a></h1>
</div>
<!--close-Header-part-->

<!--top-Header-menu-->
<div id="user-nav" class="navbar navbar-inverse">
    <ul class="nav">
        <li class="dropdown" id="profile-messages" ><a title="" href="#" data-toggle="dropdown" data-target="#profile-messages" class="dropdown-toggle"><i class="icon icon-user"></i>  <span class="text">欢迎 <?php echo ($seller); ?></span><b class="caret"></b></a></li>
        <li class=""><a title="" href="<?php echo U('Login/sellerLogin');?>"><i class="icon icon-cog"></i> <span class="text">商户登录</span></a></li>
        <li class=""><a title="" href="<?php echo U('Login/outSellerLogin');?>"><i class="icon icon-share-alt"></i> <span class="text">登出</span></a></li>
    </ul>
</div>
<!--sidebar-menu-->

<!--sidebar-menu-->

<div id="sidebar">
    <a href="#" class="visible-phone"><i class="icon icon-list"></i>Forms</a>
    <ul>
        <li>
            <a href="#"><i class="icon icon-list"></i> <span>商户自营商品</span></a>
        </li>
        <ul>
            <li><a href="<?php echo U('Business/index');?>">自营商品列表</a></li>
            <li><a href="<?php echo U('Business/addGoods');?>">自营商品添加</a></li>
        </ul>
        <li>
            <a href="#"><i class="icon icon-list"></i> <span>我的订单</span></a>
        </li>
        <ul>
            <li><a href="<?php echo U('Business/myOrder');?>">订单列表</a></li>
        </ul>
    </ul>
</div>

<div id="content">

    <div class="container-fluid">
        <hr>
        <div class="row-fluid">
            <div class="span12">

                <div class="controls controls-row">
                    <form name="orderCond" method="post">
                        <input style="display:none;" type="text" value="<?php echo U('Business/myOrder?condition=1');?>" name="pay_status_b" />
                        <input style="display:none;" type="text" value="<?php echo U('Business/myOrder?condition=2');?>" name="pay_type_b" />
                        <input style="display:none;" type="text" value="<?php echo U('Business/myOrder?condition=3');?>" name="time" />
                        <input style="display:none;" type="text" value="<?php echo U('Business/myOrder?condition=4');?>" name="order_sn_b" />
                        <input style="display:none;" type="text" value="<?php echo U('Business/myOrder?condition=5');?>" name="order_status_b" />

                        <a class="btn btn-primary" style="float:left;" href="<?php echo U('Business/myOrder');?>">所有信息</a>&nbsp;

                        <input name="order_sn" class="span2" value="" onblur="sub_pay_status(4)" placeholder="订单编码"/>

                        <select name="order_status" class="span2" onchange="sub_pay_status(5)">
                            <option selected="selected"> -- 交易状态 -- </option>
                            <option value="0">未成功</option>
                            <option value="2">成功</option>
                        </select>

                        <script>
                            var order_status=<?php echo ($order_status); ?>;
                            if(typeof(order_status)=='number'){
                                $("select[name='order_status']").children("option").each(
                                        function(){
                                            if($(this).val()==order_status)
                                            {
                                                $(this).attr("selected","selected");
                                            }
                                        }
                                );
                            }
                        </script>

                        <select name="pay_status" class="span2" onchange="sub_pay_status(1)">
                            <option selected="selected"> -- 支付状态 -- </option>
                            <option value="0">未付款</option>
                            <option value="1">付款中</option>
                            <option value="2">已付款</option>
                        </select>

                        <script>
                            var pay_status=<?php echo ($pay_status); ?>;
                            if(typeof(pay_status)=='number'){
                                $("select[name='pay_status']").children("option").each(
                                        function(){
                                            if($(this).val()==pay_status)
                                            {
                                                $(this).attr("selected","selected");
                                            }
                                        }
                                );
                            }
                        </script>

                        <select name="pay_type" class="span2" onchange="sub_pay_status(2)">
                            <option selected="selected"> -- 支付方式 -- </option>
                            <option value="0">货到付款</option>
                            <option value="1">微信支付</option>
                            <option value="2">门店自提</option>
                        </select>

                        <script>
                            var pay_type=<?php echo ($pay_type); ?>;
                            if(typeof(pay_type)=='number'){
                                $("select[name='pay_type']").children("option").each(
                                        function(){
                                            if($(this).val()==pay_type)
                                            {
                                                $(this).attr("selected","selected");
                                            }
                                        }
                                );
                            }
                        </script>

                        <input class="span2" style="width:100px" name="endTime" readonly="readonly" type="text" data-date-format="mm-dd-yyyy" class="datepicker span2" placeholder="时间范围(起)" onclick="sub_pay_status(3)">
                        <input class="span2" style="width:100px;" name="startTime" readonly="readonly" type="text" data-date-format="mm-dd-yyyy" class="datepicker span2" placeholder="时间范围(止)" onclick="sub_pay_status(3)">

                    </form>
                </div>
                <script>
                    function sub_pay_status(action)
                    {

                        if(action==1)
                        {
                            var url=$("input[name='pay_status_b']").val();
                            document.orderCond.action=url;
                            orderCond.submit();
                        }
                        else if(action==2)
                        {
                            var url=$("input[name='pay_type_b']").val();
                            document.orderCond.action=url;
                            orderCond.submit();
                        }
                        else if(action==3)
                        {
                            var startTime=$("input[name='startTime']").val();
                            var endTime=$("input[name='endTime']").val();
                            if(startTime!=""&&endTime!="")
                            {
                                var url=$("input[name='time']").val();
                                document.orderCond.action=url;
                                orderCond.submit();
                            }
                        }
                        else if(action==4)
                        {
                            if($("input[name='order_sn']").val()!="")
                            {
                                var url = $("input[name='order_sn_b']").val();
                                document.orderCond.action = url;
                                orderCond.submit();
                            }
                        }
                        else if(action==5)
                        {
                            if($("input[name='order_status']").val()!="")
                            {
                                var url = $("input[name='order_status_b']").val();
                                document.orderCond.action = url;
                                orderCond.submit();
                            }
                        }
                    }

                </script>

                <div class="widget-box">
                    <div class="widget-title"><span class="icon">
            <input type="checkbox" id="title-checkbox" name="title-checkbox" />
            </span>
                        <h5>Static table with checkboxes</h5>
                    </div>
                    <div class="widget-content nopadding">
                        <table class="table table-bordered table-striped with-check">
                            <thead>
                            <tr>
                                <th><i class="icon-resize-vertical"></i></th>
                                <th>订单状态</th>
                                <th>支付状态</th>
                                <th>支付方式</th>
                                <th>下单时间</th>
                            </tr>
                            </thead>

                            <?php if(is_array($orderList)): $i = 0; $__LIST__ = $orderList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tbody>

                                    <tr>
                                        <td><input type="checkbox" /></td>
                                        <td><a href="<?php echo U('Business/orderInfo',array('id'=>$vo[id]));?>"><?php echo ($vo["order_status_b"]); ?></a></td>
                                        <td><a href="<?php echo U('Business/orderInfo',array('id'=>$vo[id]));?>"><?php echo ($vo["pay_status_b"]); ?></a></td>
                                        <td><a href="<?php echo U('Business/orderInfo',array('id'=>$vo[id]));?>"><?php echo ($vo["pay_type_b"]); ?></a></td>
                                        <td><a href="<?php echo U('Business/orderInfo',array('id'=>$vo[id]));?>"><?php echo ($vo["add_time_b"]); ?></a></td>
                                    </tr>

                                </tbody><?php endforeach; endif; else: echo "" ;endif; ?>
                        </table>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
<script src="/thinkphp/Public/admin/js/fullcalendar.min.js"></script>
<script src="/thinkphp/Public/admin/js/matrix.calendar.js"></script>
<script src="/thinkphp/Public/admin/js/matrix.tables.js"></script>
<script src="/thinkphp/Public/admin/js/matrix.form_common.js"></script>
<script src="/thinkphp/Public/admin/js/jquery.ui.custom.js"></script>
<script src="/thinkphp/Public/admin/js/bootstrap.min.js"></script>
<script src="/thinkphp/Public/admin/js/bootstrap-colorpicker.js"></script>
<script src="/thinkphp/Public/admin/js/bootstrap-datepicker.js"></script>
<script src="/thinkphp/Public/admin/js/jquery.toggle.buttons.html"></script>
<script src="/thinkphp/Public/admin/js/masked.js"></script>
<script src="/thinkphp/Public/admin/js/jquery.uniform.js"></script>
<script src="/thinkphp/Public/admin/js/select2.min.js"></script>
<script src="/thinkphp/Public/admin/js/matrix.js"></script>
<script src="/thinkphp/Public/admin/js/wysihtml5-0.3.0.js"></script>
<script src="/thinkphp/Public/admin/js/jquery.peity.min.js"></script>
<script src="/thinkphp/Public/admin/js/bootstrap-wysihtml5.js"></script>
<script src="/thinkphp/Public/admin/js/jquery.dataTables.min.js"></script>
<script src="/thinkphp/Public/admin/js/yanGradyJS/yanGrady.js"></script>